<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="title">
            <h2><a href="#" class="back" onclick="history.go(-1)"/>Iniciar Tramite</h2>
        </ui:define>

        <ui:define name="body">
            <h:form id="protocoloForm" enctype="multipart/form-data">            
                <p:messages id="messages" closable="true" showDetail="true" autoUpdate="true"  />
                <p> 
                    <p:panel id="dadosGeraisPanel" styleClass="container_24 clearfix">
                        <h2>Filtro Protocolo</h2>
                        <br/>

                        <p:outputLabel value="Numero:" styleClass="grid_3" for="numeroInputText" />
                        <p:inputText id="numeroInputText" styleClass="grid_5" value="#{managerCriarTramite.protocolo.numero}" /> 

                        <br/>




                    </p:panel> 
                    <div class="buttonAction">
                        <p:commandButton  value="Pesquisar" styleClass="ui-priority-primary"
                                          actionListener="#{managerCriarTramite.pesquisar()}"
                                          update="@form, :protocoloForm:tramitesPanel"
                                          id="pesquisarCommandButton" icon="ui-icon-search"/>
                        <p:button value="Cancelar" icon="ui-icon-circle-close"
                                  href="indexprotocolo.xhtml" />
                    </div>

                    <p:panel id="tramitesPanel" styleClass="container_24 clearfix">

                        <h2>Tramite</h2>
                        <br/>
                        <p:outputLabel  for="secInput"
                                        value="Secretaria : " 
                                        styleClass="grid_3"/>  
                        <div class="grid_8"> 
                            <p:selectOneMenu value="#{managerCriarTramite.tramite.secretaria}" id="secInput" 
                                             converter="secretariaconverter" effect="fade">  
                                <f:selectItem  itemValue="" itemLabel=""/>
                                <f:selectItems value="#{managerCriarTramite.secretarias}" var="p" 
                                               itemLabel="#{p.nome}" itemValue="#{p}"/>  
                                <p:ajax   listener="#{managerCriarTramite.todosSetoresSec()}" update=":protocoloForm:setInput"/>
                            </p:selectOneMenu> 
                        </div> 

                        <p:outputLabel  for="setInput"
                                        value="Setor : " 
                                        styleClass="grid_3"/> 
                        <div class="grid_8">
                            <p:selectOneMenu value="#{managerCriarTramite.setor}" id="setInput" converter="setorconverter"
                                             effect="fade">  
                                <f:selectItem  itemValue="" itemLabel=""/>
                                <f:selectItems value="#{managerCriarTramite.setores}" var="p" itemLabel="#{p.nome}" itemValue="#{p}"/>  
                                <p:ajax   listener="#{managerCriarTramite.todosUsuarioSet()}" update=":protocoloForm:setServidor"/>
                            </p:selectOneMenu> 
                        </div>
                        <p:outputLabel  for="setServidor"
                                        value="Servidor : " 
                                        styleClass="grid_3"/> 
                        <div class="grid_8">
                            <p:selectOneMenu value="#{managerCriarTramite.tramite.servidor}" id="setServidor" converter="usuarioconverter"
                                             effect="fade">  
                                <f:selectItem  itemValue="" itemLabel=""/>
                                <f:selectItems value="#{managerCriarTramite.servidores}" var="p" itemLabel="#{p.nome}" itemValue="#{p}"/>  
                            </p:selectOneMenu> 
                        </div>

                        <div class="clear"/>
                        <p:outputLabel value="Parecer : " styleClass="grid_3"/>
                        <p:inputTextarea  styleClass="grid_18" value="#{managerCriarTramite.tramite.parecer}" /> 
                        <!--                        <p:outputLabel  
                                                    value="Situação : " 
                                                    styleClass="grid_3"/> 
                                                <div class="grid_8">
                                                    <p:selectOneMenu id="tipoSituacaoSelectOneMenu" panelStyle="width:150px;" 
                                                                     value="{managerCriarProtocolo.tramite.situacao}">
                                                        <f:selectItems value="{managerCriarProtocolo.tipoSituacao}"/>
                        
                                                    </p:selectOneMenu>
                                                </div>-->

                    </p:panel>
                </p>

                <!--                <p:dialog id="modalDialog" header="Confirmação de remoção" widgetVar="dlg" modal="true" 
                                          height="80" closable="true" resizable="false" >
                                    <h:outputText value="Tem certeza que deseja remover este cliente?" />
                                    <div class="buttonAction">
                                        <p:commandButton value="Sim"
                                                         actionListener="{managerPesquisarProtocolo.deletar()}"
                                                         update="@form"
                                                         icon="ui-icon-check"/>
                                        <p:commandButton value="Não" icon="ui-icon-close"
                                                         oncomplete="dlg.hide()" />
                
                                    </div>
                                </p:dialog>-->


                <div class="buttonAction">
                    <p:commandButton value="Tramitar" actionListener="#{managerCriarTramite.updTramite()}"
                                     icon="ui-icon-disk" styleClass="ui-priority-primary" 
                                     update="@form, @all" />
                    <p:button value="Cancelar" icon="ui-icon-circle-close"
                              href="indexprotocolo.xhtml" />
                </div>
            </h:form>
        </ui:define>
    </ui:composition>
</html>


